package com.chixing.day10_hashcode_exception;

import java.util.Arrays;

public class StringDemo {
    public static void main(String[] args) {
        String word="file";//在常量池中创建file
        word=word+"run";//在堆中 new 一个filerun
        word=word.toUpperCase();//在堆中  开辟内存  进行转换

//        StringBuffer stringbuffer;
        /*
        *
        * */
        StringBuilder stringbuilder1=new StringBuilder("smith");
        System.out.println(stringbuilder1);

        System.out.println(stringbuilder1.append("hello"));//拼接或追加

        System.out.println(stringbuilder1.length());

        System.out.println(stringbuilder1.reverse());//翻转

        String str=stringbuilder1.toString();
        System.out.println(str);


        System.out.println(stringbuilder1.delete(1,5));

        StringBuilder str1=stringbuilder1.insert(0,"aaa");
        System.out.println(str1);

        String s="clone-ffff-dddd";
        String[] s1=s.split("-");
        System.out.println(Arrays.toString(s1));


    }

}
